package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysEquipmentMapper;
import com.ruoyi.system.domain.SysEquipment;
import com.ruoyi.system.service.ISysEquipmentService;

/**
 * 风场设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-01
 */
@Service
public class SysEquipmentServiceImpl implements ISysEquipmentService 
{
    @Autowired
    private SysEquipmentMapper sysEquipmentMapper;

    /**
     * 查询风场设备
     * 
     * @param id 风场设备主键
     * @return 风场设备
     */
    @Override
    public SysEquipment selectSysEquipmentById(Long id)
    {
        return sysEquipmentMapper.selectSysEquipmentById(id);
    }

    /**
     * 查询风场设备列表
     * 
     * @param sysEquipment 风场设备
     * @return 风场设备
     */
    @Override
    public List<SysEquipment> selectSysEquipmentList(SysEquipment sysEquipment)
    {
        return sysEquipmentMapper.selectSysEquipmentList(sysEquipment);
    }

    /**
     * 新增风场设备
     * 
     * @param sysEquipment 风场设备
     * @return 结果
     */
    @Override
    public int insertSysEquipment(SysEquipment sysEquipment)
    {
        sysEquipment.setCreateTime(DateUtils.getNowDate());
        return sysEquipmentMapper.insertSysEquipment(sysEquipment);
    }

    /**
     * 修改风场设备
     * 
     * @param sysEquipment 风场设备
     * @return 结果
     */
    @Override
    public int updateSysEquipment(SysEquipment sysEquipment)
    {
        sysEquipment.setUpdateTime(DateUtils.getNowDate());
        return sysEquipmentMapper.updateSysEquipment(sysEquipment);
    }

    /**
     * 批量删除风场设备
     * 
     * @param ids 需要删除的风场设备主键
     * @return 结果
     */
    @Override
    public int deleteSysEquipmentByIds(Long[] ids)
    {
        return sysEquipmentMapper.deleteSysEquipmentByIds(ids);
    }

    /**
     * 删除风场设备信息
     * 
     * @param id 风场设备主键
     * @return 结果
     */
    @Override
    public int deleteSysEquipmentById(Long id)
    {
        return sysEquipmentMapper.deleteSysEquipmentById(id);
    }
}
